﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Diagnostics;

namespace WindowsGame1
{
    public static class GraphicsExtensions
    {
        public static T Copy<T>(this T valType) where T:struct
        {
            var copy = valType;
            Debug.Assert(object.ReferenceEquals(valType, copy) == false);
            return copy;
        }
        public static Rectangle InflateF(this Rectangle source,int horizontal,int vertical)
        {
            var oldLocation = source.Location;
            var oldWidth = source.Width;
            var oldHeight = source.Height;
            var copy = source;
            Debug.Assert(object.ReferenceEquals(source, copy) == false);
            copy.Inflate(horizontal,vertical);
            Debug.Assert(source.X != copy.X);
            Debug.Assert(source.Height == oldHeight);
            Debug.Assert(source.Width == oldWidth);
            return copy;
        }
        public static Rectangle Outset(this Rectangle source )
        {
            var result = source.Copy();
            
            return source.Copy().InflateF(1, 1);
        }
    }
}
